﻿using Entity;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IRepository
{
    public interface ITransferOrderRepository
    {
        // 仅保留拆分后的 ioType + ioStatus 参数的方法
        Task<List<TransferOrderDTO>> GetTransferOrdersAsync(
            string transnoNo,
            string documentStatus,
            string ioType,   // 出入库类型（out/in）
            string ioStatus, // 出入库状态（0/1/2）
            DateTime? startDate,
            DateTime? endDate,
            int pageIndex,
            int pageSize);

        Task<int> GetTransferOrdersCountAsync(
            string transnoNo,
            string documentStatus,
            string ioType,   // 出入库类型（out/in）
            string ioStatus, // 出入库状态（0/1/2）
            DateTime? startDate,
            DateTime? endDate);

        // 其他方法保持不变...
        Task<bool> DeleteAsync(int transferOrderId);
        Task<bool> BatchDeleteAsync(List<int> ids);
        Task<TransferOrderDTO> GetByIdAsync(int id);
        Task<bool> AddAsync(TransferOrderCreateDTO dto);
        Task<List<TransferOrderDetailDTO>> GetDetailsByOrderIdAsync(int transferOrderId);
        Task<bool> AuditAsync(int transferOrderId, string auditor);
        Task<bool> AuditAsync(int transferOrderId, string auditor, string auditResult);
        Task<List<TransferOrderExportDTO>> GetExportDataAsync(
            string transnoNo, string documentStatus, string ioStatus,
            DateTime? startDate, DateTime? endDate);
        Task UpdateAsync(TransferOrderDTO transferOrder);
        Task<bool> CancelAsync(int transferOrderId, string operatorUser);
        Task<bool> AuditAsync(int transferOrderId, string auditor, string auditResult, DbTransaction transaction);
        Task UpdateAsync(TransferOrderDTO transferOrder, DbTransaction transaction);
        Task<TransferOrderDTO> GetByIdAsync(int id, DbTransaction transaction);
        Task<List<TransferOrderDetailDTO>> GetDetailsByOrderIdAsync(int transferOrderId, DbTransaction transaction);
    }
}